using System;

namespace Code5Systems.FormMaster
{

	#region Class ControlLocation

	//Provides a cell location for Form elements in the Form Table
	//Using a CSV string in the Constructor example "3,2"
	//row 3 column 2
	[Serializable()]public class ControlLoaction
	{
		private int _page = 1;
		private int _row = 1;
		private int _col = 1;
		
		public ControlLoaction()
		{
			
		}
		
		public ControlLoaction(string location)
		{
			string[] aryLoc = null;
			if (location != string.Empty)
			{
				aryLoc = location.Split(char.Parse(","));
				if (aryLoc.Length == 3)
				{
					int.TryParse(aryLoc[0], out _page);

					int.TryParse(aryLoc[1], out _row);
					
					int.TryParse(aryLoc[2], out _col);
				}
			}
			
		}
		
		public int Page
		{
			get { return _page; }
			set { _page = value; }
		}

		public int Row
		{
			get { return _row; }
			set { _row = value; }
		}
		
		public int Col
		{
			get { return _col; }
			set { _col = value; }
		}
	}
#endregion
	
}
